package com.ctbri.vSearch.dao.neo4j;

import java.util.List;
import java.util.concurrent.CountDownLatch;

import org.codehaus.jackson.map.ObjectMapper;

import com.ctbri.vSearch.util.TimeUtil;
import redis.clients.jedis.Jedis;


public class Neo4jQueryThread implements Runnable{
	
	String word =null;
	List<String> nodes=null; 
	List<String> links;
	ObjectMapper mapper =null;
	String[] category =null;
	CountDownLatch countdownlatch;
	Neo4jQueryDao neo4jQuery = null;
	Jedis client = null;
	
	public Neo4jQueryThread(Neo4jQueryDao neo4jQuery,CountDownLatch countdownlatch, String word,List<String> nodes ,List<String> links, ObjectMapper mapper, String[] category, Jedis client ){
		this.word = word;
		this.nodes = nodes;
		this.links = links;
		this.mapper = mapper;
		this.category = category;
		this.countdownlatch = countdownlatch;
		this.neo4jQuery = neo4jQuery;
		this.client = client;
	}
	
	@Override
	public void run() {
		neo4jQuery.firstQuery(word, nodes, links, mapper, category, client);
		neo4jQuery.secondQuery(word, nodes, links, mapper, client);
		countdownlatch.countDown();
	}
	
}
